package spike.pool;

import java.io.IOException;
import java.net.Socket;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by dmitry on 11/12/14.
 */
public class MyConnectionSource implements ConnectionSource<Socket> {

    @Override
    public Socket open() {
        try {
            return new Socket("localhost", 10000);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

    @Override
    public void close(Socket obj) {

        if (obj != null) {
            try {
                obj.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
